package com.itheima.Controller;


import com.itheima.Service.ValidateCodeService;
import com.itheima.common.entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
public class LoginController {
    @Autowired
    private ValidateCodeService validateCodeService;

    @PostMapping("/validatecode/send4Order")
    public void submitOrder(@RequestParam String telephone){
        validateCodeService.send4Login(telephone);
    }

    @PostMapping("/member/login")
    public void login( @RequestBody Map<String,String> loginMessage){
        validateCodeService.login(loginMessage);
    }

    @GetMapping("/validatecode/send4Login")
    public Result UserLogin(@RequestParam String telephone){
        validateCodeService.send4Login(telephone);
        return new Result(true,"发送成功",null);
    }



}
